package org.dmd.wsdl.server.generated.dmw;

// Generated from: org.dmd.util.codegen.ImportManager.getFormattedImports(ImportManager.java:82)
// Called from: org.dmd.dmg.generators.BaseDMWGenerator.dumpWrapper(BaseDMWGenerator.java:442)
import java.util.ArrayList;                                                     // To support getMVCopy() - (BaseDMWGenerator.java:1181)
import java.util.Iterator;                                                      // Support copy of MV objects - (BaseDMWGenerator.java:2240)
import org.dmd.dmc.*;                                                           // If any attributes - (BaseDMWGenerator.java:1087)
import org.dmd.dmc.definitions.DmcDefinitionIF;                                 // The object is a domain specific definition - (BaseDMWGenerator.java:411)
import org.dmd.dmc.types.DefinitionName;                                        // Is named by - (BaseDMWGenerator.java:1062)
import org.dmd.dms.ClassDefinition;                                             // Passing derived class def up the hierarchy - (BaseDMWGenerator.java:1067)
import org.dmd.dms.generated.dmo.MetaDMSAG;                                     // Required for MODREC constructor - (BaseDMWGenerator.java:1072)
import org.dmd.dms.generated.types.DmcTypeModifierMV;                           // Required for MODREC constructor - (BaseDMWGenerator.java:1071)
import org.dmd.wsdl.server.extended.WsdlDefinition;                             // Derived class - (BaseDMWGenerator.java:1248)
import org.dmd.wsdl.server.extended.XsElement;                                  // Is reference type - (BaseDMWGenerator.java:1107)
import org.dmd.wsdl.server.extended.XsSchema;                                   // Required for getModificationRecorder() - (BaseDMWGenerator.java:1076)
import org.dmd.wsdl.server.extended.XsType;                                     // Is reference type - (BaseDMWGenerator.java:1107)
import org.dmd.wsdl.server.generated.dmw.NameSpaceReferenceIterableDMW;         // For multi-valued NameSpaceReference - (BaseDMWGenerator.java:2103)
import org.dmd.wsdl.server.generated.dmw.XsElementIterableDMW;                  // For multi-valued XsElement - (BaseDMWGenerator.java:1709)
import org.dmd.wsdl.server.generated.dmw.XsTypeIterableDMW;                     // For multi-valued XsType - (BaseDMWGenerator.java:1709)
import org.dmd.wsdl.shared.generated.dmo.DmwsdlDMSAG;                           // Attribute elements from the dmwsdl schema - (BaseDMWGenerator.java:897)
import org.dmd.wsdl.shared.generated.dmo.XsElementDMO;                          // For multi-valued adds of XsElement - (BaseDMWGenerator.java:1767)
import org.dmd.wsdl.shared.generated.dmo.XsSchemaDMO;                           // Class not auxiliary or abstract - (BaseDMWGenerator.java:1252)
import org.dmd.wsdl.shared.generated.dmo.XsTypeDMO;                             // For multi-valued adds of XsType - (BaseDMWGenerator.java:1767)
import org.dmd.wsdl.shared.generated.types.NameSpaceReference;                  // Primitive type - (BaseDMWGenerator.java:1150)
import org.dmd.wsdl.shared.generated.types.WsdlModuleREF;                       // Required to access defined in module name - (DMWGenerator.java:180)



/**
 * A placeholder to represent an XML schema specification - this would be
 * defined as\n a separate set of definitions in reality.
 * <P>
 * Generated from the dmwsdl schema at version unknown
 * <P>
 * This code was auto-generated by the dmggenerator utility and shouldn't be alterred manually!
 * Generated from: org.dmd.dmg.generators.BaseDMWGenerator.dumpWrapper(BaseDMWGenerator.java:479)
 */
abstract public class XsSchemaDMW extends WsdlDefinition implements DmcDefinitionIF, DmcNamedObjectIF {

    // Generated from: org.dmd.dmg.generators.BaseDMWGenerator.dumpWrapper(BaseDMWGenerator.java:558)
    public XsSchemaDMW() {
        super(new XsSchemaDMO(), org.dmd.wsdl.server.generated.DmwsdlSchemaAG._XsSchema);
    }

    // Generated from: org.dmd.dmg.generators.BaseDMWGenerator.dumpWrapper(BaseDMWGenerator.java:564)
    public XsSchemaDMW(DmcTypeModifierMV mods) {
        super(new XsSchemaDMO(mods), org.dmd.wsdl.server.generated.DmwsdlSchemaAG._XsSchema);
    }

    // Generated from: org.dmd.dmg.generators.BaseDMWGenerator.dumpWrapper(BaseDMWGenerator.java:606)
    public XsSchema getModificationRecorder(){
        XsSchema rc = new XsSchema();
        rc.setName(getName());
        rc.setModifier(new DmcTypeModifierMV(MetaDMSAG.__modify));
        return(rc);
    }

    // Generated from: org.dmd.dmg.generators.BaseDMWGenerator.dumpWrapper(BaseDMWGenerator.java:627)
    public XsSchemaDMW(XsSchemaDMO obj) {
        super(obj, org.dmd.wsdl.server.generated.DmwsdlSchemaAG._XsSchema);
    }

    public XsSchema cloneIt() {
        XsSchema rc = new XsSchema();
        rc.setDmcObject(getDMO().cloneIt());
        return(rc);
    }

    public XsSchemaDMO getDMO() {
        return((XsSchemaDMO) core);
    }

    // Generated from: org.dmd.dmg.generators.BaseDMWGenerator.dumpWrapper(BaseDMWGenerator.java:642)
    protected XsSchemaDMW(XsSchemaDMO obj, ClassDefinition cd) {
        super(obj,cd);
    }

    // org.dmd.dmg.generators.BaseDMWGenerator.getAccessFunctions(BaseDMWGenerator.java:1297)
    public DefinitionName getObjectName(){
        return(((XsSchemaDMO) core).getName());
    }

    public int hashCode(){
        return(getObjectName().hashCode());
    }

    public DmcAttribute<?> getObjectNameAttribute(){
        return(((XsSchemaDMO) core).getObjectNameAttribute());
    }

    public boolean equals(Object obj){
        if (obj instanceof XsSchemaDMW){
            return( getObjectName().equals( ((XsSchemaDMW) obj).getObjectName()) );
        }
        return(false);
    }

    /**
     * @return The number of XsElement items.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:1671)
    public int getElementsSize(){
        return(((XsSchemaDMO) core).getElementsSize());
    }

    /**
     * @return true if there are no XsElementDMO items.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:1679)
    public boolean getElementsIsEmpty(){
        if (((XsSchemaDMO) core).getElementsSize() == 0)
            return(true);
        return(false);
    }

    /**
     * @return true if there are any XsElementDMO items.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:1689)
    public boolean getElementsHasValue(){
        if (((XsSchemaDMO) core).getElementsSize() == 0)
            return(false);
        return(true);
    }

    /**
     * @return An Iterator of XsElementDMO objects.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:1716)
    public XsElementIterableDMW getElementsIterable(){
        DmcAttribute<?> attr = core.get(DmwsdlDMSAG.__elements);
        if (attr == null)
            return(XsElementIterableDMW.emptyList);
        
        return(new XsElementIterableDMW(((XsSchemaDMO) core).getElements()));
    }

    /**
     * Adds another elements value.
     * @param value A value compatible with XsElement
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:1773)
    public DmcAttribute<?> addElements(XsElement value){
        DmcAttribute<?> attr = ((XsSchemaDMO) core).addElements(((XsElementDMO)value.getDmcObject()));
        return(attr);
    }

    /**
     * Deletes a elements value.
     * @param value The XsElement to be deleted from set of attribute values.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:1823)
    public void delElements(XsElement value){
        ((XsSchemaDMO) core).delElements(value.getDMO());
    }

    /**
     * @return A COPY of the collection of XsElement objects.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:1887)
    public ArrayList<XsElement> getElementsCopy(){
        DmcAttribute<?> attr = ((XsSchemaDMO) core).get(DmwsdlDMSAG.__elements);
        if (attr == null)
            return(new ArrayList<XsElement>());
        
        ArrayList<XsElement> rc = new ArrayList<XsElement>(attr.getMVSize());
        
        XsElementIterableDMW it = getElementsIterable();
        while(it.hasNext()){
            rc.add(it.next());
        }
        
        return(rc);
    }

    /**
     * Removes the elements attribute value.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:2292)
    public void remElements(){
        ((XsSchemaDMO) core).remElements();
    }

    // org.dmd.dmg.generators.BaseDMWGenerator.formatSV(BaseDMWGenerator.java:1474)
    public DefinitionName getName(){
        return(((XsSchemaDMO) core).getName());
    }

    /**
     * Sets name to the specified value.
     * @param value A value compatible with DmcTypeDefinitionName
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatSV(BaseDMWGenerator.java:1584)
    public void setName(Object value) throws DmcValueException {
        ((XsSchemaDMO) core).setName(value);
    }

    /**
     * Sets name to the specified value.
     * @param value DefinitionName
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatSV(BaseDMWGenerator.java:1593)
    public void setName(DefinitionName value){
        ((XsSchemaDMO) core).setName(value);
    }

    /**
     * Removes the name attribute value.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatSV(BaseDMWGenerator.java:1619)
    public void remName(){
        ((XsSchemaDMO) core).remName();
    }

    /**
     * @return The number of NameSpaceReference items.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:1671)
    public int getNameSpaceSize(){
        return(((XsSchemaDMO) core).getNameSpaceSize());
    }

    /**
     * @return true if there are no NameSpaceReferenceDMO items.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:1679)
    public boolean getNameSpaceIsEmpty(){
        if (((XsSchemaDMO) core).getNameSpaceSize() == 0)
            return(true);
        return(false);
    }

    /**
     * @return true if there are any NameSpaceReferenceDMO items.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:1689)
    public boolean getNameSpaceHasValue(){
        if (((XsSchemaDMO) core).getNameSpaceSize() == 0)
            return(false);
        return(true);
    }

    /**
     * @return An Iterator of NameSpaceReference objects.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:2107)
    public NameSpaceReferenceIterableDMW getNameSpaceIterable(){
        DmcAttribute<?> attr = core.get(DmwsdlDMSAG.__nameSpace);
        if (attr == null)
            return(NameSpaceReferenceIterableDMW.emptyList);
        
        return(new NameSpaceReferenceIterableDMW(((XsSchemaDMO) core).getNameSpace()));
    }

    /**
     * Adds another nameSpace value.
     * @param value A value compatible with NameSpaceReference
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:2133)
    public void addNameSpace(Object value) throws DmcValueException {
        ((XsSchemaDMO) core).addNameSpace(value);
    }

    /**
     * Adds another nameSpace value.
     * @param value A value compatible with NameSpaceReference
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:2143)
    public void addNameSpace(NameSpaceReference value){
        ((XsSchemaDMO) core).addNameSpace(value);
    }

    /**
     * Returns true if the collection contains the nameSpace value.
     * @param value A value compatible with NameSpaceReference
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:2200)
    public boolean nameSpaceContains(NameSpaceReference value){
        return(((XsSchemaDMO) core).nameSpaceContains(value));
    }

    /**
     * @return A COPY of the collection of NameSpaceReference objects.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:2244)
    @SuppressWarnings("unchecked")
    public ArrayList<NameSpaceReference> getNameSpaceCopy(){
        DmcAttribute<?> attr = core.get(DmwsdlDMSAG.__nameSpace);
        if (attr == null)
            return(new ArrayList<NameSpaceReference>());
        
        ArrayList<NameSpaceReference> rc = new ArrayList<NameSpaceReference>(attr.getMVSize());
        
        Iterator<NameSpaceReference> it = (Iterator<NameSpaceReference>) attr.getMV();
        while(it.hasNext()){
            rc.add(it.next());
        }
        
        return(rc);
    }

    /**
     * Deletes a nameSpace value.
     * @param value The NameSpaceReference to be deleted from set of attribute values.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:2271)
    public void delNameSpace(Object value) throws DmcValueException {
        ((XsSchemaDMO) core).delNameSpace(value);
    }

    /**
     * Deletes a nameSpace value.
     * @param value The NameSpaceReference to be deleted from set of attribute values.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:2280)
    public void delNameSpace(NameSpaceReference value){
        ((XsSchemaDMO) core).delNameSpace(value);
    }

    /**
     * Removes the nameSpace attribute value.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:2292)
    public void remNameSpace(){
        ((XsSchemaDMO) core).remNameSpace();
    }

    // org.dmd.dmg.generators.BaseDMWGenerator.formatSV(BaseDMWGenerator.java:1474)
    public String getTargetNameSpace(){
        return(((XsSchemaDMO) core).getTargetNameSpace());
    }

    /**
     * Sets targetNameSpace to the specified value.
     * @param value A value compatible with DmcTypeString
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatSV(BaseDMWGenerator.java:1584)
    public void setTargetNameSpace(Object value) throws DmcValueException {
        ((XsSchemaDMO) core).setTargetNameSpace(value);
    }

    /**
     * Sets targetNameSpace to the specified value.
     * @param value String
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatSV(BaseDMWGenerator.java:1593)
    public void setTargetNameSpace(String value){
        ((XsSchemaDMO) core).setTargetNameSpace(value);
    }

    /**
     * Removes the targetNameSpace attribute value.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatSV(BaseDMWGenerator.java:1619)
    public void remTargetNameSpace(){
        ((XsSchemaDMO) core).remTargetNameSpace();
    }

    /**
     * @return The number of XsType items.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:1671)
    public int getXstypesSize(){
        return(((XsSchemaDMO) core).getXstypesSize());
    }

    /**
     * @return true if there are no XsTypeDMO items.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:1679)
    public boolean getXstypesIsEmpty(){
        if (((XsSchemaDMO) core).getXstypesSize() == 0)
            return(true);
        return(false);
    }

    /**
     * @return true if there are any XsTypeDMO items.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:1689)
    public boolean getXstypesHasValue(){
        if (((XsSchemaDMO) core).getXstypesSize() == 0)
            return(false);
        return(true);
    }

    /**
     * @return An Iterator of XsTypeDMO objects.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:1716)
    public XsTypeIterableDMW getXstypesIterable(){
        DmcAttribute<?> attr = core.get(DmwsdlDMSAG.__xstypes);
        if (attr == null)
            return(XsTypeIterableDMW.emptyList);
        
        return(new XsTypeIterableDMW(((XsSchemaDMO) core).getXstypes()));
    }

    /**
     * Adds another xstypes value.
     * @param value A value compatible with XsType
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:1773)
    public DmcAttribute<?> addXstypes(XsType value){
        DmcAttribute<?> attr = ((XsSchemaDMO) core).addXstypes(((XsTypeDMO)value.getDmcObject()));
        return(attr);
    }

    /**
     * Deletes a xstypes value.
     * @param value The XsType to be deleted from set of attribute values.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:1823)
    public void delXstypes(XsType value){
        ((XsSchemaDMO) core).delXstypes(value.getDMO());
    }

    /**
     * @return A COPY of the collection of XsType objects.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:1887)
    public ArrayList<XsType> getXstypesCopy(){
        DmcAttribute<?> attr = ((XsSchemaDMO) core).get(DmwsdlDMSAG.__xstypes);
        if (attr == null)
            return(new ArrayList<XsType>());
        
        ArrayList<XsType> rc = new ArrayList<XsType>(attr.getMVSize());
        
        XsTypeIterableDMW it = getXstypesIterable();
        while(it.hasNext()){
            rc.add(it.next());
        }
        
        return(rc);
    }

    /**
     * Removes the xstypes attribute value.
     */
    // org.dmd.dmg.generators.BaseDMWGenerator.formatMV(BaseDMWGenerator.java:2292)
    public void remXstypes(){
        ((XsSchemaDMO) core).remXstypes();
    }

    // Generated from: org.dmd.dmg.generators.DMWGenerator.dumpAdditionalWrapperFunctions(DMWGenerator.java:221)
    /**
     * This method indicates the name of the module from which this definition was loaded.
     */
    @Override
    public String getNameOfModuleWhereThisCameFrom(){
        WsdlModuleREF ref = ((XsSchemaDMO) core).getDefinedInWsdlModule();
        return(ref.getName().getNameString());
    }


}
